import App from './App';
import store from './store/index';
import apiUrls from '@/common/api/url.js';
import { http } from '@/common/api/index.js';
import { Router } from '@/common/utils/index.js';
import utils from '@/common/utils/utils';
import { BASE_URL, IMG_BASE_URL, IS_DEV, SYSTEM_CONFIG } from '@/common/config.js';
import uTabbar from '@/components/tabbar/index.vue';
import uFab from '@/components/uni-fab/uni-fab.vue';

Vue.component('u-tabbar', uTabbar)
Vue.component('u-fab', uFab)

Vue.config.productionTip = false;

// Vue.prototype.$urouter = router;
Vue.prototype.$api = http;
// Vue.prototype.$message = message;
Vue.prototype.$util = utils;
Vue.prototype.$store = store;
// Vue.prototype.$validate = validate;

global.apiUrls = apiUrls;
global.IS_DEV = IS_DEV == 0 ? 0 : 1;
global.SYSTEM_CONFIG = SYSTEM_CONFIG;

App.mpType = 'app';

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App,
  store
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif